package com.mzw.mzwinterface.controller;

import com.mzw.mzwclientsdk.model.SongName;
import com.mzw.mzwclientsdk.model.Word;
import com.yupi.yucongming.dev.client.YuCongMingClient;
import com.yupi.yucongming.dev.common.BaseResponse;
import com.yupi.yucongming.dev.model.DevChatRequest;
import com.yupi.yucongming.dev.model.DevChatResponse;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author L1nAn
 */
@RestController
@RequestMapping("song")
public class SongController {
    @Resource
    private YuCongMingClient yuCongMingClient;
    @PostMapping("/name")
    public String getWordTranslation(@RequestBody SongName songName) {
        DevChatRequest devChatRequest = new DevChatRequest();
        devChatRequest.setModelId(1651468516836098050L);
        devChatRequest.setMessage(songName.getSongName());
        BaseResponse<DevChatResponse> response = yuCongMingClient.doChat(devChatRequest);
        return response.getData().getContent();
    }
}
